package com.sibu.yx.promotion.admin.web.controller.sys;

import com.doubo.common.model.request.common.CommonRequest;
import com.doubo.common.model.response.CommonResponse;
import com.sibu.yx.promotion.admin.web.controller.BaseController;
import com.sibu.yx.promotion.persistence.model.sys.SysUser;
import com.sibu.yx.promotion.service.sys.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author yuwenbo
 * @create 2019-02-16 14:47
 **/
@RestController
@RequestMapping(value = "/user",produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class SysUserController extends BaseController {

    @Autowired
    private SysUserService sysUserService;

    @RequestMapping(value = "/getCurrentUser", method = RequestMethod.GET)
    public CommonResponse<SysUser> getCurrentUser(CommonRequest request) {
        return sysUserService.selectUserById(request.getCurrentUserId());
    }
}
